
package com.studiofortress.sf.graphics.display;

/**
 * This is a marker class for events. It doesn't do anything other then provide
 * a superclass which is lower then Object (which obviously could mean anything).
 * 
 * It also defines a handled flag for stating if the event has been used or not.
 * Once the flag is set then it will be ignored by the SF framework internally.
 *
 * After you have used the event you should call setHandled() so it's flagged to
 * be ignored.
 * 
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 */
public abstract class ControlEvent
{
    private boolean isHandled;

    /**
     * Trivial constructor.
     */
    ControlEvent()
    {
        isHandled = false;
    }
    
    /**
     * Flags this as being handled and so shouldn't be used anymore.
     */
    public void setHandled()
    {
        isHandled = true;
    }
    
    /**
     * States if this ControlEvent has been handled or not.
     * @return True if this has been handled and should no longer be used, otherwise false.
     */
    public boolean isHandled()
    {
        return isHandled;
    }
}
